<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class post extends CI_Controller {
    //put your code here
    function _remap($method)
    {
        $param_offset = 2;

        // Default to index
        if ( ! method_exists($this, $method))
        {
            // We need one more param
            $param_offset = 1;
            $method = 'index';
        }

        // Since all we get is $method, load up everything else in the URI
        $params = array_slice($this->uri->rsegment_array(), $param_offset);

        // Call the determined method with all params
        call_user_func_array(array($this, $method), $params);
    }
    
    function index($post_id = -1) {
        if($post_id == -1) {
            $this->load->view('welcome_message');
            return;
        }
        $data['main_content'] = 'view_post';
        $data['article'] = $this->Article->get_article($post_id);
        $this->load->view('includes/template', $data);
    }
}

?>
